﻿    
function SetVehicleTypeAndTransRatio(me) {
    var vehicleId = me.selectedIndex;
    document.getElementById("GearingRec_VehicleTypeId").value = VehicleTypes[vehicleId];
    document.getElementById("transmissionRatio").value =  TransRatios[vehicleId];
}

function UpdateVoltage() {
    var cellType = document.getElementById("GearingRec_CellTypeId").options[document.getElementById("GearingRec_CellTypeId").selectedIndex].text;
    var cellCount= document.getElementById("cellCount").value;
        
    switch (cellType){
        case "NiCd":
            voltage=1.2;
            break;
        case "NiMh":
            voltage=1.2;
            break;
        case "LiFe":
            voltage=3.3;
            break;
        case "LiPo":
            voltage=3.7;
            break;
    }
    document.getElementById("Voltage").value = Math.round(cellCount * voltage*10)/10;
}

function SetFdr() {
    var pinion = document.getElementById("GearingRec_Pinion").value;
    var spur = document.getElementById("GearingRec_Spur").value;
    var transRatio = document.getElementById("transmissionRatio").value;

    var fdr = ((spur / pinion) * transRatio)*10/10;

    document.getElementById("GearingRec_FDR").value = fdr;
}